package crawler;

import java.io.File;
import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class FileTest {
	
	public static void main(String [] args){
		File input=new File("c:/yy/yy.htm");
		
		try {
			Document doc=Jsoup.parse(input,"UTF-8");
			Elements links = doc.getElementsByTag("a");
			for(Element link:links){
				Element parent=link.parent();
				Element grand=parent.parent();
				
				Elements money=grand.select(".price");
				System.out.println(money.size());
				for(Element e:money){
					System.out.println(e.text());
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
